package com.cskaoyan.bean.leihao.po;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Auther: leihao
 * @Date: Created in 10:37 2022/6/28
 */

@NoArgsConstructor
@Data
public class CreatePo {

    @JsonProperty("goods")
    private GoodsDTO goods;
    @JsonProperty("specifications")
    private List<SpecificationsDTO> specifications;
    @JsonProperty("products")
    private List<ProductsDTO> products;
    @JsonProperty("attributes")
    private List<AttributesDTO> attributes;

    @NoArgsConstructor
    @Data
    public static class GoodsDTO {
        @JsonProperty("picUrl")
        private String picUrl;
        @JsonProperty("gallery")
        private String[] gallery;
        @JsonProperty("isHot")
        private Boolean isHot;
        @JsonProperty("isNew")
        private Boolean isNew;
        @JsonProperty("isOnSale")
        private Boolean isOnSale;
        @JsonProperty("goodsSn")
        private String goodsSn;
        @JsonProperty("name")
        private String name;
        @JsonProperty("counterPrice")
        private BigDecimal counterPrice;
        @JsonProperty("unit")
        private String unit;
        @JsonProperty("keywords")
        private String keywords;
        @JsonProperty("categoryId")
        private Integer categoryId;
        @JsonProperty("brandId")
        private Integer brandId;
        @JsonProperty("brief")
        private String brief;
        @JsonProperty("detail")
        private String detail;
    }

    @NoArgsConstructor
    @Data
    public static class SpecificationsDTO {
        @JsonProperty("specification")
        private String specification;
        @JsonProperty("value")
        private String value;
        @JsonProperty("picUrl")
        private String picUrl;
    }

    @NoArgsConstructor
    @Data
    public static class ProductsDTO {
        @JsonProperty("id")
        private Integer id;
        @JsonProperty("specifications")
        private List<String> specifications;
        @JsonProperty("price")
        private BigDecimal price;
        @JsonProperty("number")
        private Integer number;
        @JsonProperty("url")
        private String url;
    }

    @NoArgsConstructor
    @Data
    public static class AttributesDTO {
        @JsonProperty("attribute")
        private String attribute;
        @JsonProperty("value")
        private String value;
    }
}
